package net.zjitc.seqstack;

/**
 * Created by Administrator on 2017/3/23.
 */
public class DiGuiDemo {
    public static void main(String[] args) {
        int s= sum(10);
        System.out.println(s);
    }
    public static int sum(int sum){
        if (sum==1){
            return 1;
        }else{
            return sum+sum(sum-1);
        }
    }
}
